﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;

namespace ConceptCorporateAdmin.Gui
{
    public partial class NewTableDialog : Form
    {
        public NewTableDialog()
        {
            InitializeComponent();
        }

        String ret = "";

        private void NewTableDialog_Load(object sender, EventArgs e)
        {

        }

        public static string ShowMe()
        {
            NewTableDialog dlg = new NewTableDialog();
            dlg.ShowDialog();
            return dlg.ret;
        }

        private void BtnOk_Click(object sender, EventArgs e)
        {
            ret = "<table border='{0}' cellspacing='{1}' cellpadding='{2}'>";
            ret = String.Format(ret, TxtBorder.Value, TxtCellSpacing.Value, TxtCellPadding.Value);
            for (int i = 0; i < TxtNrRanduri.Value; i++)
            {
                ret += "<tr>";
                for (int j = 0; j < TxtNrColoane.Value; j++)
                {
                    ret += "<td>&nbsp;</td>";
                }
                ret += "</tr>";
            }
            ret += "</table>";
            Close();
        }

        private void BtnRenunta_Click(object sender, EventArgs e)
        {
            this.Close();
        }
    }
}
